package com.tjmc.recruit.finance.api.feign;

import com.tjmc.recruit.common.core.constant.SecurityConstants;
import com.tjmc.recruit.common.core.constant.ServiceNameConstants;
import com.tjmc.recruit.common.core.util.R;
import com.tjmc.recruit.finance.api.dto.AccountChangeDTO;
import com.tjmc.recruit.finance.api.entity.PlatformUserAccountEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "accountService", value = ServiceNameConstants.FINANCE_SERVICE)
public interface RemoteAccountService {
    /**
     * 创建账户
     * @param platformUserAccount 账户信息
     * @param from
     * @return
     */
    @PostMapping("/platformUserAccount")
    R createAccount(@RequestBody PlatformUserAccountEntity platformUserAccount, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 账户数据变更
     * @param changeDTO 变更信息
     * @param from
     * @return
     */
    @PutMapping("/platformUserAccount/changeAccountInfo")
    R changeAccountInfo(@RequestBody AccountChangeDTO changeDTO, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询指定账户信息
     * @param accountId 用户ID
     * @param from
     * @return
     */
    @GetMapping("/platformUserAccount/{accountId}")
    R<PlatformUserAccountEntity> getAccountInfo(@PathVariable("accountId") String accountId, @RequestHeader(SecurityConstants.FROM) String from);
}
